home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / CW GUSI 1.6.4 / include / GUSIMPW_P.h < prev    next >
Text File  |  1994-12-31  |  2KB  |  80 lines

  1. /*********************************************************************
  2. Project    :    GUSI                -    Grand Unified Socket Interface
  3. File        :    GUSIMPW_P.h        -    Internals of MPW runtime architecture
  4. Author    :    Matthias Neeracher
  5. Language    :    MPW C/C++
  6.  
  7. $Log: GUSIMPW_P.h,v $
  8. Revision 1.2  1994/12/31  02:14:49  neeri
  9. CatchStdIO
  10.  
  11. Revision 1.1  1994/08/10  00:38:49  neeri
  12. Sanitized for universal headers.
  13.  
  14. *********************************************************************/
  15.  
  16. /* This file defines some internal structures of the MPW C Library. 
  17.    PowerPC GUSI unfortunately needs to access these to cooperate 
  18.     with stdio. As these structures seem to be embedded in the ROM 
  19.     of the PowerMacs, it doesn't seem to be likely that they will 
  20.     change anytime soon. 
  21. */
  22.  
  23. /* These should always remain 32 bit quantities */
  24.  
  25. typedef int         int32;
  26. typedef long         long32;
  27. typedef unsigned    unsigned32;
  28.  
  29. struct MPWIOEntry;
  30.  
  31. extern "C" {
  32. typedef int32    (*MPWAccessFunction)(char * name, unsigned int cmd, long *arg);
  33. typedef int32    (*MPWIOFunction)(MPWIOEntry * entry);
  34. typedef int32    (*MPWIOCtlFunction)(MPWIOEntry * entry, unsigned int cmd, long *arg);
  35.  
  36. int32 MPWFAccessGlue(char * name, unsigned int cmd, long *arg);
  37. int32    MPWCloseGlue(MPWIOEntry * entry);
  38. int32    MPWReadGlue(MPWIOEntry * entry);
  39. int32    MPWWriteGlue(MPWIOEntry * entry);
  40. int32    MPWIOCtlGlue(MPWIOEntry * entry, unsigned int cmd, long *arg);
  41. }
  42.  
  43. struct MPWIOVector {
  44.     OSType                type;
  45.     UniversalProcPtr    faccess;
  46.     UniversalProcPtr    close;
  47.     UniversalProcPtr    read;
  48.     UniversalProcPtr    write;
  49.     UniversalProcPtr    ioctl;
  50. };
  51.  
  52. struct MPWIOEntry {
  53.     short                flags;    // See open() mode in FCntl.h
  54.     OSErr                error;
  55.     MPWIOVector    *    funcs;
  56.     int32                userData;
  57.     unsigned32        length;
  58.     char *            buffer;
  59. };
  60.  
  61. struct MPWSeekArg {
  62.     int32        whence;
  63.     long32    offset;
  64. };
  65.  
  66. extern MPWIOVector GUSIIOGlue;
  67. extern Boolean         CatchStdIO;
  68.  
  69. extern "C" {
  70. MPWIOEntry *     _getIOPort(int32 * fd);
  71. int32                _addDevHandler(
  72.                         int32                 slot, 
  73.                         OSType                type,
  74.                         MPWAccessFunction    faccess,
  75.                         MPWIOFunction        close,
  76.                         MPWIOFunction        read,
  77.                         MPWIOFunction        write,
  78.                         MPWIOCtlFunction    ioctl);
  79. }
  80.